package cc.comac.mom.util.user;


import cc.comac.mom.api.UsersSelCmd;
import cc.comac.mom.model.table.jflow.UsersDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class UserUtil {


    @Autowired
    private UsersSelCmd usersSelCmd;

    public  UsersDO getUserInfoByEcode(String code) {
        UsersDO usersDO = new UsersDO();
        try {
            usersDO = usersSelCmd.selectUserByEcode(code);
        } catch (Exception e) {
            usersDO = new UsersDO();
            usersDO.setTruename("系统默认");
        }
       return usersDO;
    }

    public  String getUserTrueNameInfoByEcode(String code) {

        return this.getUserInfoByEcode(code).getTruename();
    }
}
